home *** CD-ROM | disk | FTP | other *** search
-
- #ifndef __INICONFIGREADER_H_
- #define __INICONFIGREADER_H_
- /*
- Peon - Win32 Games Programming Library
- Copyright (C) 2002-2005 Erik Yuzwa
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Erik Yuzwa
- peon AT wazooinc DOT com
- */
-
- // Precompiler options
- #include "peonstdafx.h"
-
-
-
- namespace peon
- {
- /**
- * This object is usefull for loading and storing any information
- * we might need for our game contained in an .INI file. We can
- * store anything from our wanted renderer, to our application window
- * size, to even some basic scripting elements.
- *
- * Note that this object is completely Win32-specific. It is using
- * the GetPrivateProfile* family of API functions which I think are
- * only available on Windows.
- */
- class PEONMAIN_API IniConfigReader
- {
-
- protected:
- /** our ini filename */
- String m_strFileName;
-
- public:
-
- /**
- * Constructor
- * @param String - path to ini file
- */
- IniConfigReader(const String& strFile);
-
- /**
- * Destructor
- */
- ~IniConfigReader();
-
- /**
- * This method is responsible for grabbing any string data from our
- * ini file
- * @param String - our ini section
- * @param String - our key name
- * @param String - our default key value
- * @param String& - a string object to contain our resulting data
- * @return DWORD - the size of our data string
- */
- DWORD getString(const String sSection, const String sKey, const String sDefault, String& sReturn);
-
- /**
- * This method is just responsible for grabbing the UINT value
- * from our ini file
- * @param String - section name
- * @param String - key name
- * @param int - default key value
- * @return UINT - our returned key value
- */
- UINT getInt(String sSection, String sKeyName, int);
-
- /**
- * This method is responsible for grabbing any boolean information
- * stored in our ini file
- * @param String - section name
- * @param String - key name
- * @param String - default key value "TRUE" or "FALSE"
- * @return bool - our actual key value
- */
- bool getBool(const String sSection, const String sKeyName, const String sDefault);
-
- /**
- * This method is responsible for grabbing any float information stored
- * in our INI file
- * @param String sSection - section name
- * @param String sKeyName - key name
- * @param String sDefault - default value of float (ie. "1.0f")
- * @return float - our determined float value
- */
- float getFloat(String sSection, String sKeyName, String sDefault);
-
- };
-
- }
-
- #endif